package cc.wsyw126.java.jvm.reflectThinking;

import java.lang.reflect.Field;

/**
 * Created by Administrator on 2017/4/17.
 */
public class Get {
    public Object getProperty(Object owner, String fieldName) throws Exception {
        Class ownerClass = owner.getClass();
        Field field = ownerClass.getField(fieldName);
        Object property = field.get(owner);

        return property;

    }
}
